import request from '@/utils/request'

export function loginApi(data) {
  return request({
    url: '/user-service/user/login',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/vue-admin-template/user/info',
    method: 'get',
    params: { token }
  })
}

export function logout() {
  return request({
    url: '/vue-admin-template/user/logout',
    method: 'post'
  })
}

// 获取验证码图片
export function getImageCode(num) {
  return request({
    url: `/user-service/user/imageCode/${num}`,
    responseType: 'arraybuffer'
  })
}
// 上传图片
export function getImageSrc(data) {
  return request({
    url: '/vm-service/sku/fileUpload',
    method: 'post',
    headers: { 'Content-Type': 'multipart/form-data' },
    data
  })
}
